﻿// Write a boolean expression for finding if the bit 3 (counting from 0) of a given integer is 1 or 0.

using System;

class ChckIf3rdBitIs1Or0
{
    static void Main()
    {
        Console.Write("Enter your number: ");
        int number = int.Parse(Console.ReadLine());
        int mask = 1 << 3;
        int numberAndMask = number & mask;
        int bit = numberAndMask >> 3;
        Console.WriteLine("The third bit of the digit is: {0}", bit);
        // for 15 is 1, for 5 is 0
    }
}
